<?php
session_start();
include_once("config.php");
checkLoggedIn("yes");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php print $title; ?></title>
</head>
<style type="text/css">
<!--
@import url("style.css");
-->
</style>

<body>
<?php

echo "<div class=\"body\">";
doCSS();
print("Bienvenido:  <b>".$_SESSION["login"]."</b><br>\n");
print("<a href=\"logout.php"."\">Logout</a><br>");
print("<a href=\"members.php"."\">Volver</a><br>");

$result = mysql_query("SELECT * from ".$tabla_tracking." where user_id ='".$_SESSION["login"]."'", $link);
$numlineas = mysql_num_rows($result);

for ($linea = 0; $linea < $numlineas ; $linea++)
{
	echo "<br><div class=\"results-title\"><strong>Registro: ".mysql_result($result,$linea,"trk")." - ".mysql_result($result,$linea,"comentario")."</strong></div><br>";
	$string = "http://www.heavy-nacional.com.ar/paquetesystem/ext.php?id=".mysql_result($result,$linea,"trk")."&action=oidn";
	$handle = fopen($string,"r");
	while (($buffer = fgets($handle)) !== false) 
	{
		$cond1 = strpos($buffer,"Ver movimientos para el seguimiento nacional.");
		$cond2 = strpos($buffer,"Imprimir");
		$cond3 = strpos($buffer,"<table class=\"table table-hover span12\">");
		if ( $cond1 === false && $cond2 === false )
		{
			if ( $cond3 === false ) echo $buffer;
			else echo "<table id=\"hor-minimalist-b\" summary=\"Detalle pagos\">";
		}
    	}

}
?>
</body>
</html>
